home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / AMOSList / AMOSLIST.0897 / 000323_amos-request@svcs1.digex.net_Sun Aug 31 18:27:43 1997.msg < prev    next >
Text File  |  1997-09-09  |  6KB  |  173 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail3.access.digex.net (8.8.5/8.8.5) with ESMTP id SAA08416
  3.     for <mcox@access.digex.net>; Sun, 31 Aug 1997 18:27:42 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id QAA22093
  6.     for amos-out; Sun, 31 Aug 1997 16:04:33 -0400 (EDT)
  7. Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id QAA22090
  9.     for <amos-list@svcs1.digex.net>; Sun, 31 Aug 1997 16:04:32 -0400 (EDT)
  10. Received: from punt-1.mail.demon.net (punt-1c.mail.demon.net [194.217.242.136])
  11.     by mail1.access.digex.net (8.8.5/8.8.5) with SMTP id QAA04845
  12.     for <amos-list@access.digex.net>; Sun, 31 Aug 1997 16:04:29 -0400 (EDT)
  13. Received: from agasinc.demon.co.uk ([193.237.4.98]) by punt-1.mail.demon.net
  14.            id ac1124430; 31 Aug 97 20:16 BST
  15. From: Andy Gibson <andy@agasinc.demon.co.uk>
  16. To: Amos List <amos-list@access.digex.net>
  17. Date: Sun, 31 Aug 1997 18:18:56 -0000
  18. Message-ID: <yam7182.2836.4666824@post.demon.co.uk>
  19. X-Mailer: YAM 1.3.4 [020] - Amiga Mailer by Marcel Beck
  20. Organization: AGAS Productions
  21. Subject: Some handy Hints
  22. MIME-Version: 1.0
  23. Content-Type: text/plain; charset=iso-8859-1
  24. Content-Transfer-Encoding: 8bit
  25. X-MIME-Autoconverted: from quoted-printable to 8bit by svcs1.digex.net id QAA22091
  26. Status: O
  27. X-Status: 
  28.  
  29.  
  30. Hi there guys (AGAIN!)
  31.  
  32. Andy Gibson here with some tips for ya all...
  33.  
  34. 1:
  35. ~~
  36. Have  you  ever  had this message when trying to compile an Amos prog via
  37. the Pro Compiler ... `Not an Amos Program'???
  38.  
  39. It's the silliest message in the world if you ask me!
  40.  
  41. Anyway,  I've  had  this  on a number of occasions and eventually found a
  42. solution to it.
  43.  
  44. My  program  had  a sprite bank, an iff bank and two (or more) data banks
  45. filled  with plain ascii text. (these cozed the probs). If I removed just
  46. one of the data banks, it compiled fine, but not with two or more!
  47.  
  48. What I found was that if I loaded in the Sprites, then the piccy followed
  49. by  the  two  banks  (in that order), it would compile fine. But not if I
  50. loaded  a  text  bank again (after editing etc)! It had to all be done in
  51. one go! With the sprites first, followed by the iff bank and then all the
  52. text banks.
  53.  
  54. In other words, load all the banks in, then compile straight away.
  55.  
  56. Strange - but I hope this helps some of you out.
  57.  
  58.  
  59. 2:
  60. ~~
  61. When  creating  a  program  with  an  Icon  Bank, if compiled via the Pro
  62. compiler,  the  exe file won't run on an A500/A600!!! It will run fine on
  63. an  A1200  though! The way round this is to either save your icon bank to
  64. disk  and  just  load  it from there (thus removing it from bank 2 before
  65. compiling)  or save out each icon to an iff file and store that as an iff
  66. bank  (which  can  be compiled in your code :) and just grab the icons as
  67. you need them - maybe as the first port of call in your listing etc.
  68.  
  69. I  heard the old classic compiler doesn't have this problem and if you
  70. compile  with  an  icon bank using an A500 with the Pro Compiler - all
  71. should be fine too! (Don't quote me on this though)
  72.  
  73.  
  74. 3:
  75. ~~
  76. When  using  the  HUNT command (in a loop) it keeps on searching for your
  77. search  string,  but  won't  stop at the first occurence! It continues on
  78. searching  to  the end of the file! This is bad news for a search routine
  79. as you can imagine.
  80.  
  81. eg. You have a list of cheats in a text file and at the end of each cheat
  82. you have a `*' to mark that it's the end of this cheat....
  83.  
  84.  
  85. eg (crude example)
  86.  
  87. CHEAT1:
  88. blah blah blah
  89. *
  90. CHEAT2:
  91. doh doh doh doh!!!
  92. *
  93. CHEAT3:
  94. wibble wibble wibble etc
  95. *
  96.  
  97. To get this text into a bank....
  98.  
  99. F$="HD1:Cheat.txt"
  100. Open 1,F$
  101. P=Lof(1)
  102. Close 1
  103. Reserve As Work 10,P
  104. Bload F$,Start(10)
  105.  
  106. Now  I'll  show you the usual way to HUNT, but this will stop at the LAST
  107. `*' found - not the first :(
  108.  
  109. BNK=Start(10)
  110. POS=Start(BNK)
  111. S$="*"
  112.  
  113. Do
  114. Exit If POS>Bank End(BNK)
  115. H=Hunt(POS to Bank End(BNK),S$)
  116. Exit If H=0 or H=Bank End(BNK)
  117. POS=H+1
  118. Loop
  119.  
  120. (BTW  I  can't  remember which extension uses the `Bank End' command, but
  121. you could just use something like:
  122.  
  123. _LAST=Start(BNK) to Start(BNK)+Length(BNK)
  124.  
  125. Just replace all the `Bank End(BNK)' with `_LAST' instead then :)
  126.  
  127. OK,  as  you can see, the Hunt command stops at the last `*' found in the
  128. file, so why not try the great LDOS command...Lset Eoln (num)
  129.  
  130. This  way,  we can change the end of line (usually chr$(10)) to something
  131. more useful such as the `*' char maybe - which is Chr$(42).
  132.  
  133. So this would be..
  134.  
  135. ' Value to search for is Chr$(42) which = `*'
  136. Lset Eoln 42
  137.  
  138. So now we can find this and stop at the FIRST occurrence, we need to copy
  139. the string to a new string (or even another bank).
  140.  
  141. B$=Lstr(POS to bank End(BNK)) : Rem hold it in a new string (LDOS)
  142. '
  143. ' Copy to a bank, but only if need be...
  144. L=Len(B$)
  145. Reserve As Work 20,L
  146. Lbstr B$,Start(20) : Rem Another great LDOS Command :)
  147.  
  148. In that example, B$ would hold the following:
  149.  
  150. CHEAT1:
  151. blah blah blah
  152.  
  153. (unlike the Hunt command version which would hold all the cheats!!!)
  154.  
  155. And  there you have it. Just update POS to search for further `*' in your
  156. text. It's easy to do. LDOS has many other great functions, so use it!!!
  157.  
  158. OK.  I'll  leave it there for now, but I shall be back to torture you all
  159. with more top tips later (maybe).
  160.  
  161. -- 
  162.            _             _        _         _    CU next time, same bat
  163.  9T7      _)\        ____)\      _)\   _____)\   time, same bat channel
  164.          /o� \      /o�____)    /o� \ /o�_____)
  165.  .�.    //    \    // /  __    //    \\\ \____    .�. 
  166.  -*-   /.  O   \  /. /___\ \  /.  O   \\____  \   -*- 
  167.  ï¿½ï¿½ï¿½  /    _    \/   Y   Y  \/    _    \ ___\\ \  ï¿½ï¿½ï¿½ 
  168.       \ __/ \___/\_________ /\___/ \ __//______/
  169.        Y                   Y        Y   Y         L8R
  170.        :                   :        ï¿½   ï¿½
  171.        .   Andy Gibson (AGAS Productons)�
  172.        ï¿½        -=<(aka SKiDZ/A51)>=-   :
  173.